package code;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;


public class PrimeNumber {
	
	private List<Integer> prime;
	private final int Max=10000;
	
	public PrimeNumber(){
		prime=new ArrayList<Integer>();
		int i,j;
		for(i=2;i<Max;i++){
			for(j=0;j<prime.size();j++){
				if(i%prime.get(j)==0)	break;
			}
			if(j==prime.size()){
				prime.add(i);
			}
		}
	}
	
	
	public static void main(String[] args) throws IOException{
		PrimeNumber pn=new PrimeNumber();
		System.out.println(pn.prime.size());
		Scanner in=new Scanner(System.in);
		while(true){
			int n,m;
//			System.out.println("璇疯緭鍏,m锛歯<=m,骞朵笖閮�= 1229,杈撳叆-1锛岃〃绀虹粨鏉�");
			n=in.nextInt();
			if(n==-1)	break;
			m=in.nextInt();
			for(int i=n;i<=m && i<pn.prime.size();i++){
				System.out.println("绗�+i"+"涓皬浜�0000鐨勭礌鏁版槸锛�"+pn.prime.get(i-1)+" ");
			}
		}
		System.out.println("宸查�鍑虹▼搴忥紒");
	}
}
